package fi.bluepill.server.model;


import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import java.util.HashSet;
import java.util.Set;

@Entity
public class Comment extends AbstractEntity {
    @OneToMany(fetch = FetchType.LAZY)
    private Set<Comment> children = new HashSet<Comment>();

    @ManyToOne(fetch = FetchType.LAZY)
    private Comment parent;

    private String text;
    private String userId;
    private String entityId;

    public Set<Comment> getChildren() {
        return children;
    }

    public Comment getParent() {
        return parent;
    }

    public void setParent(Comment parent) {
        this.parent = parent;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getEntityId() {
        return entityId;
    }

    public void setEntityId(String entityId) {
        this.entityId = entityId;
    }
}
